<template>
  <view class="head">
    <view
      class="icon"
      v-if="icon"
    >
     <text
        class="iconfont icon-zuojiantou"
        @click="fanhui()"
      > </text> | <text
        class="iconfont icon-shouye"
        @click="zhuye()"
      ></text>
    </view>
    {{title}}

  </view>
</template>

<script>
export default {
  props: ["title", "icon"],
  data: () => ({}),
  computed: {},
  methods: {
    fanhui() {
      uni.navigateBack();
    },
    zhuye() {
      uni.navigateTo({
        url: "/pages/index/index",
        success: (res) => {
          console.log(111);
        },
      });
    },
  },
  watch: {},

  // 组件周期函数--监听组件挂载完毕
  mounted() {},
  // 组件周期函数--监听组件数据更新之前
  beforeUpdate() {},
  // 组件周期函数--监听组件数据更新之后
  updated() {},
  // 组件周期函数--监听组件激活(显示)
  activated() {},
  // 组件周期函数--监听组件停用(隐藏)
  deactivated() {},
  // 组件周期函数--监听组件销毁之前
  beforeDestroy() {},
};
</script>

<style lang="scss" scoped>
.head {
  background-color: gold;
  width: 100%;
  height: 75px;
  font-size: 18px;
  line-height: 80px;
  text-align: center;
  position: relative;
  color: white;
  .icon {
    width: 90px;
    height: 30px;
    background: #fffffd;
    color: black;
    display: flex;
    justify-content: space-evenly;
    border-radius: 15px;
    line-height: 30px;
    position: absolute;
    left: 8px;
    top: 28px;
  }
  .title {
    margin-top: 10px;
  }
}
</style>
